<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <link rel="stylesheet" type="text/css" href="./css/style.css" />
        <title>Command Link</title>
    </h:head>
    <h:body>
        <h:form styleClass="formCadastro">
            <div>Nome:</div><h:inputText value="${listaDeAlunos.alunoTemp.nome}"></h:inputText>
            <div>Sobrenome:</div><h:inputText value="${listaDeAlunos.alunoTemp.sobreNome}"></h:inputText>
            <div>Nota:</div><h:inputText value="${listaDeAlunos.alunoTemp.nota}"></h:inputText><br />
            <h:commandButton value="Incluir" action="#{listaDeAlunos.inserir}" styleClass="btSubmit" />
        </h:form>
        <h:form>
            <h:dataTable cellspacing="2" var="aluno" value="#{listaDeAlunos.alunos}" styleClass="tabelaAlunos">
                <h:column>
                    <f:facet name="header" >
                        Nome
                    </f:facet>
                    #{aluno.nome}
                </h:column>
                <h:column>
                    <f:facet name="header" >
                        Sobrenome
                    </f:facet>
                    #{aluno.sobreNome}
                </h:column>
                <h:column>
                    <f:facet name="header" >
                        Nota
                    </f:facet>
                    #{aluno.nota}
                </h:column>
                <h:column>
                    <h:commandLink action="#{listaDeAlunos.atualizar(aluno)}">
                        <h:graphicImage value="./img/seta.png" styleClass="imgSeta"/>
                    </h:commandLink>
                </h:column>
                <h:column>
                    <h:commandLink action="#{listaDeAlunos.apagar(aluno)}">
                        <h:graphicImage value="./img/delete.png" styleClass="imgSeta"/>
                    </h:commandLink>
                </h:column>
        </h:dataTable>
        </h:form>
    </h:body>
</html>

